package main

type treeNode struct {
	val int
	left *treeNode
	right *treeNode
}
func main()  {
	
}

func traverseTree(root *treeNode)  {
	var ret [][]int
	i := 0
	var que []*treeNode
	que = append(que,root)
	j :=len(que)
	k := 1
	if i < j {
		node := que[i]
		if k >= len(ret) {
			ret = append(ret,[]int{})
		}
		i++
		ret[k] = append(ret[k],node.val)
		if node.left != nil {
			que = append(que,node.left)
		}

		if node.right != nil {
			que = append(que,node.right)
		}
		if i >= j{
			k++
			j = len(que)
		}

	}
}